import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: () => import('../views/LoginView.vue')
    },
    {
      path: '/main',
      name: 'main',
      component: () => import('../views/MainView.vue'),
      redirect: '/index',
      children: [
        {
          path: '/index',
          name: 'index',
          component: () => import('../views/IndexView.vue')
        },
        {
          path: '/business',
          name: 'business',
          component: () => import('../views/admin/BusinessView.vue')
        },
        {
          path: '/users',
          name: 'users',
          component: () => import('../views/admin/users/UserList.vue')
        },
        {
          path: '/roles',
          name: 'roles',
          component: () => import('../views/admin/roles/RoleList.vue')
        },
        {
          path: '/userAddRoles',
          name: 'userAddRoles',
          component: () => import('../views/admin/users/UserAddRoles.vue')
        },
        {
          path: '/rooms',
          name: 'rooms',
          component: () => import('../views/bussiness/room/RoomList.vue')
        },
        {
          path: '/pet1',
          name: 'pet1',
          component: () => import('../views/pet1/PetAdopt.vue')
        },
        {
          path: '/pet2',
          name: 'pet2',
          component: () => import('../views/pet2/pet_aid.vue')
        },
        {
          path: '/pet3',
          name: 'pet3',
          component: () => import('../views/pet3/helphome.vue')
        },
        {
          path: '/pet4',
          name: 'pet4',
          component: () => import('../views/pet4/feed_home.vue')
        },
        {
          path: '/pet5',
          name: 'pet5',
          component: () => import('../views/pet5/petloss.vue')
        },
        { path: '/pet6', name: 'pet6', component: () => import('../views/pet4/feed_home_add.vue') },
        { path: '/pet7', name: 'pet7', component: () => import('../views/pet2/pet_aid_add.vue') },
        { path: '/pet8', name: 'pet8', component: () => import('../views/pet3/add_post.vue') },
        { path: '/pet9', name: 'pet9', component: () => import('../views/pet5/add_petloss.vue') }
      ]
    }
  ]
})

export default router
